Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 4 - Colors and Color-Related Objects / Colors and Color-Related Objects Reference
Color Functions /


GXCheckColor

You can use the GXCheckColor function to determine if a color is either within a given gamut in a particular color space, or representable in a given color set.

boolean GXCheckColor(const gxColor *source, gxColorSpace space, 
                      gxColorSet aSet, gxColorProfile profile);
source
A pointer to the color to check.
space
The color space to check the source color against.
aSet
A reference to a color set to check the source color against. This parameter must be nil if the space parameter is not gxIndexedSpace.
profile
A reference to a color profile to check the source color against. GXCheckColor determines whether the source color is within the color gamut represented by this profile and the space color space.
function result
true if the source color is contained in the specified color set, or if it is within the gamut of the specified color space and color profile; otherwise, false.
DESCRIPTION
The GXCheckColor function has two purposes. One is that you can use it to see if a given color exactly matches a color within a color set. For example, you can test whether a color matches a Pantone® or other spot color standard. To do this check, make sure that the space parameter specifies indexed color space and that the aSet parameter is not nil.

You can also use the GXCheckColor function to see if a given color can be drawn on a given view device. The function converts the source color to the color space represented in the space parameter, using the color profile in the profile parameter. If the resulting color is out of the gamut represented by space and profile, the function returns false.

SPECIAL CONSIDERATIONS
If you are using this function to test a color against a color set, it is unlikely to find a match (which must be exact) unless the source color and the color set referenced in the aSet parameter are based on the same color space and use identical color profiles.

ERRORS, WARNINGS, AND NOTICES
Errors
out_of_memory 
color_is_nil
colorSpace_out_of_range(debugging version)
Warnings 
colorSet_index_out_of_range 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996